The present invention relates generally to thermometer-to-binary encoding systems and in particular to a thermometer-to-binary encoding system which minimizes the error in an output binary code resulting from an out-of-sequence error in an input thermometer code.
A number may be represented by a thermometer code wherein successive bits of a data word are assigned progressively larger values, all of the bits having assigned values below or the same as the number being set to a logical true state, and all of the bits having values higher than the number being set to a logical false state. In a typical analog-to-digital (A/D) converter, a reference voltage is divided into a set of progressively smaller reference voltage quantum levels and a comparator associated with each quantum level compares an analog input voltage with the voltage quantum, generating an output true state if the input voltage is higher than the voltage quantum reference. The outputs of all of the comparators thus form the bits of a thermometer code representing the magnitude of the input voltage when arranged in order of the associated reference voltage quantum level magnitudes.
In comparison to most other commonly used codes, thermometer codes do not represent numbers efficiently in terms of the number of bits required. For instance, an eight bit thermometer code can represent any one of 9 different numbers (including 0) while a typical eight bit binary code can represent 256 different numbers. Therefore the thermometer code output of an A/D converter is usually converted by an encoding circuit to another more compact and useful binary code before being transmitted as data to external circuits.
A problem arises when the bits of the thermometer code are out-of-sequence, i.e., when logical-true bits in the code are separated by one or more intervening logical-false bits. This can sometimes happen when the thermometer code is produced by an A/D converter when sampling a high frequency signal if the individual comparators of the converter do not all switch at the same speed. For instance, if the input voltage is falling at the time it is sampled, a lower order comparator which is relatively fast may switch to a low output state before a higher order comparator, which is relatively slower, switches. When the out-of-sequence thermometer code is applied as an input to a typical thermometer-to-binary encoder, the output of the thermometer-to-binary encoder bears little relation to the actual magnitude of the sampled voltage. It has been shown experimentally that for many A/D converters a good approximation of the most likely particular magnitude of a sampled voltage which produces an out-of-sequence thermometer code is obtained by simply counting the logical-true bits in the out-of-sequence thermometer code. It would be advantageous if the thermometer-to-binary encoder would produce a binary code output in response to an out-of-sequence thermometer code input which would be as close as possible to this "ideal" approximation result. It should be noted that the technique of counting the logical-true bits also correctly encodes an in-sequence thermometer code input.